using System;
using PHSRAG.Security;


namespace PHSRAG.Insight21.ClinicalTrials
{	
	public class CTAccessHelper
	{	
		public static bool IsUserReadPending(int accessLevel)
		{				
			return ((accessLevel & (int)Security.Enumerations.AccessRightBit.ReadPendingBudgets) == (int)Security.Enumerations.AccessRightBit.ReadPendingBudgets);
		}

		public static bool IsUserModifyPending(int accessLevel)
		{
			return ((accessLevel & (int)Security.Enumerations.AccessRightBit.ModifyPendingBudgets) == (int)Security.Enumerations.AccessRightBit.ModifyPendingBudgets);		
		}

		public static bool IsUserReadFinal(int accessLevel)
		{
			return ((accessLevel & (int)Security.Enumerations.AccessRightBit.ReadFinalBudgets) == (int)Security.Enumerations.AccessRightBit.ReadFinalBudgets);		
		}
		
		public static bool IsUserModifyFinalDeleteBudget(int accessLevel)
		{
			return ((accessLevel & (int)Security.Enumerations.AccessRightBit.ModifyFinalDeleteBudgets) == (int)Security.Enumerations.AccessRightBit.ModifyFinalDeleteBudgets);		
		}
		
		public static bool IsUserCreateNewBudget(int accessLevel)
		{
			return ((accessLevel & (int)Security.Enumerations.AccessRightBit.CreateNewBudgets) == (int)Security.Enumerations.AccessRightBit.CreateNewBudgets);		
		}

		public static bool IsUserAdministrator(int accessLevel)
		{
			return ((accessLevel & (int)Security.Enumerations.AccessRightBit.BudgetAdministrator) == (int)Security.Enumerations.AccessRightBit.BudgetAdministrator);		
		}
	}
}